import React from 'react';
import {renderRoutes} from "react-router-config";
import {Button, Card} from "antd";
import {connect, useDispatch, useSelector, useStore} from 'react-redux'
import {bindActionCreators} from 'redux'
import {setCount} from './action'

function Count() {
    const count=useSelector(state=>state.counter.count);
    const dispatch=useDispatch();

    console.log('store',useStore());

    const handleCountChange = () => {
        dispatch(setCount(count+1))
    };

    return (
        <Card>
            <h2>Count hook{count}</h2>
            <Button onClick={handleCountChange}>更改数字</Button>
        </Card>
    )
}

export default Count;
